 <meta charset="utf-8">
<div class="box box-primary" id="app_authUser_pwd_reset">
            <form role="form" id="pwdResetForm">
              <div class="box-body" style="overflow: hidden;">
               <div class="form-group">
                  <label for="roleCode">新密码</label>
                  <input type="password"  v-model="authUser.password"  name="password" class="form-control" id="roleCode" placeholder="请输入密码"  required aria-required="true" >
                </div> 
                
                 <div class="form-group">
                  <label for="name">确认新密码</label>
                  <input type="password" name="password"   v-model="authUser.repeatPassword"  class="form-control" id="name" placeholder="请输入角色名称" required>
                </div> 
              </div>
              <!-- /.box-body -->
              <div class="box-footer">
                 <button type="button" class="btn btn-default" v-on:click="cancel">取消</button>
                 <button type="button" class="btn btn-info pull-right"  v-on:click="confirm">提交</button>
              </div>
            </form>
<script src="static/libs/jquery-md5/jquery.md5.min.js" type="text/javascript" ></script>
<script type="text/javascript">
var vm = new Vue({
        el: '#app_authUser_pwd_reset',
        data: {
        	authUser:{
        			account: undefined,
        			userId: undefined,
        			password: undefined,
        			repeatPassword: undefined
        		 },
        	    bus:new Vue()
        },
        mounted:function(){
       	 let param=zfesLayerEditDg.getLayerParam();
       	 this.authUser.userId=param.id;
       	 this.authUser.account=param.account;
       	 console.log(JSON.stringify(this.authUser));
        },
         methods: {
       	  confirm: function(){
       		if($("#pwdResetForm").valid()){
       			if(this.authUser.password!=this.authUser.repeatPassword){
       				alertSwal.warningText("密码不一致");
       				return;
       			}
       			let _this=this;
       		  _this.authUser.password=this.convertPassword(account,_this.authUser.password);
       		 _this.authUser.repeatPassword=_this.authUser.password;
       		  let ajaxUrl="auth/authUser/resetAuthUserPwd";
       			zfesAjax.ajaxTodo(ajaxUrl, _this.authUser, function(data) {
					alertSwal.successText(data.message);
					zfesLayerEditDg.close();
				});
       		}
       		
  	  	  },
  	  	  convertPassword:function(account,password){
				var salt=account+"@zhtframework_94DABGioQOq2tTUO0AXYow";
				return hex_md5(salt+password);
		  },
  		  cancel: function(){
  	  		zfesLayerEditDg.close();
  	  	  }
        }
    })

 </script>
</div>